LOCAL_PATH := device/huawei/maimang5

# Bootloader
TARGET_NO_BOOTLOADER := true
TARGET_BOOTLOADER_BOARD_NAME := MSM8953

# Platform
TARGET_BOARD_PLATFORM := msm8953
TARGET_BOARD_PLATFORM_GPU := qcom-adreno506

# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := generic

TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := cortex-a53

BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci 
BOARD_KERNEL_BASE := 0x80000000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_MKBOOTIMG_ARGS := --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100

TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernel

# Init
TARGET_INIT_VENDOR_LIB := libinit_maimang5
TARGET_RECOVERY_DEVICE_MODULES := libinit_maimang5

# Power
#TARGET_POWERHAL_VARIANT := qcom

# Qualcomm support
#BOARD_USES_QCOM_HARDWARE := true
TARGET_PLATFORM_DEVICE_BASE := /devices/soc/

# Partitions
BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64)
BOARD_BOOTIMAGE_PARTITION_SIZE := 83886080     #80MB
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 83886080 #80MB
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3879731200 #3.6GB
BOARD_USERDATAIMAGE_PARTITION_SIZE := 57050906112 #53GB

WITH_CM_CHARGER := false

# Crypto
TARGET_HW_DISK_ENCRYPTION := true
TW_INCLUDE_CRYPTO := true

# Recovery
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true
BOARD_HAS_LARGE_FILESYSTEM := true

BOARD_USE_CUSTOM_RECOVERY_FONT := \"roboto_15x24.h\"
TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"

#HAVE_SELINUX := true

#BOARD_SEPOLICY_DIRS += \
#    $(LOCAL_PATH)/sepolicy

#BOARD_SEPOLICY_UNION += \
#    device.te \
#    file.te \
#    file_contexts \
#    qseecom.te

# TWRP
RECOVERY_VARIANT := twrp
TW_NO_USB_STORAGE := true

TW_THEME := portrait_hdpi
TARGET_RECOVERY_FSTAB := $(LOCAL_PATH)/twrp.fstab
TARGET_RECOVERY_QCOM_RTC_FIX := true
RECOVERY_SDCARD_ON_DATA := true

#TW_TARGET_USES_QCOM_BSP := true


TW_EXTERNAL_STORAGE_PATH := "/external_sd"
TW_EXTERNAL_STORAGE_MOUNT_POINT := "external_sd"

TW_CUSTOM_BATTERY_PATH := "/sys/class/power_supply/battery"
TW_BRIGHTNESS_PATH := "/sys/class/leds/lcd-backlight/brightness"
